package by.msokoloff.javaweb2015.services;

import java.util.List;

import javax.persistence.metamodel.SingularAttribute;

import org.springframework.transaction.annotation.Transactional;

import by.msokoloff.javaweb2015.datamodel.Airport;

public interface AirportService {

	Airport get(Integer id);

	List<Airport> getAll();

	List<Airport> getAll(SingularAttribute<Airport, ?> attr, boolean ascending, int startRecord, int pageSize);

	List<Airport> getByField(SingularAttribute<Airport, ?> attr, Object val);

	List<Airport> getContaining(String val, Integer max);
	
	Long getCount();

	@Transactional
	void createOrUpdate(Airport airport);

	@Transactional
	void delete(Airport airport);

	@Transactional
	void deleteAll();

	@Transactional
	void deleteWithRelations(Airport airport);

}
